﻿
namespace MikeWare.Tests.MikeLoggor
{
    using System;
    using System.Diagnostics;
    using System.IO;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    using MikeWare.Components.MikeLoggor;

    [TestClass]
    public class UnitTestMikeLoggor
    {
        [TestMethod]
        public void TestMethod1()
        {
            var watch = new Stopwatch();
            var file = new FileInfo(@"D:\MikeWare\tests\Build\loggor.setting");
            watch.Start();
            using (var loggor = new Loggor(file.FullName))
            {
                try
                {
                    for (int i = 0; i < 1000; i++)
                    {
                        loggor.WriteLine("this is a test message, the no is " + i + ".");
                    }
                }
                catch (Exception ex)
                {
                    Trace.Write(ex.ToString());
                }
            }
            watch.Stop();
            Trace.WriteLine("Using " + watch.Elapsed.TotalSeconds.ToString("0.0000") + "s.");
        }
    }
}
